﻿@using Utils;
@model WebUI.Models.DesignersViewModel
@{
    ViewBag.Title = "Designers";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="mainCol">
    <div><h2>Find Designers</h2></div>
    <div class="smallspacer"></div>
    @if (Model.TotalCount > 0)
    {
        if (Model.IsEmptySearchParam)
        { 
            <div class="searchcriteria">@Model.TotalCount Designers</div>
        }
        else
        {
            if (Model.IndLoginList.Count == 1)
            {
                <div class="searchcriteria">@Model.TotalCount Designer <span>match your criteria</span></div>
            }
            else
            {
                <div class="searchcriteria">@Model.TotalCount Designers <span>match your criteria</span></div>
            }
        }
    }
    <div class="tabsbottom"></div>
    <div class="clear"></div>
    @if (Model.IndLoginList.Count > 0)
    {
    <ol class="player-cards">
        @for (int i = 0; i < Model.IndLoginList.Count; i++)
        {
            var indLogin = Model.IndLoginList[i];
            <li>
                <div class="player-info">
                    <div class="player-cards-profile">
                        <div class="fl">
                            <a href="@Url.Action("Shots", "Ind", new { UserName = indLogin.Login.UserName })" title="@indLogin.Ind.FullName">
                                <img class="avatar80" src="@Url.StaticFile(indLogin.Ind["AvatarUrl"])" alt="@indLogin.Ind.FullName"/>
                            </a>
                        </div>
                        <div class="vsmallspacer"></div>
                        <div class="fl">
                            <h1>
                                <a href="@Url.Action("Shots", "Ind", new { UserName = indLogin.Login.UserName })" title="@indLogin.Ind.FullName">@indLogin.Ind.FullName</a>
                                @if (indLogin.Ind.AvailableForHire)
                                {
                                <span rel="tipsy" original-title="@indLogin.Ind.FullName is available for hire. To send a work inquiry, use the Hire Me button on this designer's profile.">
                                    <img src="@Url.StaticFile("/content/images/icon-contact.png")" width="14"/>
                                </span>
                                }
                            </h1>
                            <div class="profile-title">
                                <span>@indLogin.Ind.Title</span>
                            </div>
                            <div class="profile-detail">
                                <div class="fl">
                                    <a href="@Url.Action("Designers", new { location = indLogin.Ind.Location })" class="locality">@indLogin.Ind.Location</a>
                                </div>
                            </div>
            
                            <div class="clear"></div>
                        </div>
                    </div>
                </div>
                <div class="shots">
                    @foreach (var shot in indLogin.Ind.ShotList)
                    {
                        <a href="/shots/@shot.ShotID" title="@shot.Title">
                            <img alt="@shot.Title" src="@shot["ShotUrl"]"/>
                        </a>
                    }
                </div>
                @*<div class="action">
                    <div class="smallspacer"></div>
                    <div class="saved-info">Saved</div>
                    <div class="saved-info">@indLogin.Ind.SavedDate.ToDateTimeString()</div>
                    <div class="smallspacer"></div>
                    <div class="unsave"><a href="/account/unsave?loginid=@indLogin.Login.LoginID" rel="unsave">Unsave</a></div>
                </div>*@
                <div class="clear"></div>
            </li>
        }
    </ol>
    <div class="clear"></div>
    <div class="page">
        <div class="paging">
        @if (Model.PreviousPage > 0)
        {
            <a href="@Url.Action("designers", Model.ParamForPrevious)" class="action pagingaction" rel="prev">← Newer</a>
        }
        @if (Model.NextPage > 0)
        {
            <a href="@Url.Action("designers", Model.ParamForNext)" class="action pagingaction" rel="next">Older →</a>
        }
        </div>
    </div>
    }
    else
    { 
    <div class="null-message">
	    <h2>None</h2>
    </div>
    }
    <div class="clear"></div>
</div>
<div class="sideCol">
    @using (Html.BeginForm("Designers", "Search", FormMethod.Post))
    { 
        <div class="searchfilter">
            <div class="item">
                <label>Show Only</label>
                <div class="clear"></div>
                @Html.CheckBoxFor(m => m.AvailableForHire) <span class="cbLabel">Available for hire</span>
            </div>
            <div class="item">
                @Html.LabelFor(m => m.Skills)
                <div class="clear"></div>
                @Html.TextBoxFor(m => m.Skills)
                <div class="uihelper">Use commas for multiple skills</div>
            </div>
            <div class="item">
                @Html.LabelFor(m => m.Location)
                <div class="clear"></div>
                @Html.TextBoxFor(m => m.Location)
                <div class="uihelper">Enter a city, state, or country</div>
            </div>
            
            <div><input type="submit" name="search" id="search" class="orange-submit" value="Search"/></div>
        </div>
    }
</div>

@section FooterContent
{
    <script type="text/javascript" src="@Url.StaticFile("~/content/jquery.form.js")"></script>
    <script type="text/javascript" src="@Url.StaticFile("~/content/jquery.tipsy.js")"></script>
    <script type="text/javascript">
        $(document).ready(function () { 
            
        })
    </script>
}

